﻿package net.wangit.support.action;

import net.wangit.context.ActionContext;
import net.wangit.context.ActionContextHelper;
import net.wangit.framework.session.AgileSession;
import net.wangit.support.Action;

/**
 * 使页面转向到访问链中的前一个URL。
 * 
 * @author watson Feb 25, 2010
 */
public class BackAction implements Action {

	public BackAction() {
	}

	// 设置转向URL。
	public ActionContext execute(ActionContext ac) throws Exception {
		AgileSession session = ActionContextHelper.getSession(ac);
		ac.getActionResult().setUrl(session.gePreviousUrl());
		return ac;
	}
}
